package com.SouthernWall_404.AgeRight.Common.Init;

import com.SouthernWall_404.AgeRight.Common.AgeRight;
import com.SouthernWall_404.AgeRight.Common.world.items.KeyItem;
import com.SouthernWall_404.AgeRight.Common.world.items.LockItem;
import com.google.common.collect.Sets;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Rarity;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.RegistryObject;

import java.util.LinkedHashSet;
import java.util.function.Supplier;

public class ModItems {

    public static final DeferredRegister<Item> ITEMS=DeferredRegister.create(Registries.ITEM, AgeRight.MODID);
    public static LinkedHashSet<RegistryObject<Item>> CREATIVE_TAB_ITEMS = Sets.newLinkedHashSet();


    public static RegistryObject<Item> registerWithTab(final String name, final Supplier<Item> supplier) {
        RegistryObject<Item> item = ITEMS.register(name, supplier);
        CREATIVE_TAB_ITEMS.add(item);


        return item;
    }

    public static final RegistryObject<Item> LOCK = registerWithTab("lock",
            () -> new LockItem(new Item.Properties()
                    .rarity(Rarity.UNCOMMON)
                    .stacksTo(1)
                    .fireResistant()
            ));

    public static final RegistryObject<Item> KEY = registerWithTab("key",
            () -> new KeyItem(new Item.Properties()
                    .rarity(Rarity.UNCOMMON)
                    .stacksTo(1)
                    .fireResistant()
            ));
}
